/**
 * 
 */
package com.maohi.software.arii.mvc;

import com.google.inject.Key;

/**
 * @author heifara
 * 
 * @param <M>
 *            The type of the Model
 * @param <U>
 *            The type of the UI
 */
public interface Controller<M, U> {

	/**
	 * Return the appropriate instance for <b>aClass</b>
	 * 
	 * @param aClass
	 *            the class
	 * @return the appropriate instance
	 */
	<T> T getInstance(Class<T> aClass);

	/**
	 * Return the appropriate instance for <b>aClass</b> and <b>aId</b>
	 * 
	 * @param aClass
	 *            the class
	 * @param aId
	 *            the id
	 * @return the appropriate instance
	 */
	<T> T getInstance(Class<T> aClass, String aId);

	/**
	 * Return the appropriate instance for <b>aKey</b>
	 * 
	 * @param aKey
	 *            the key
	 * @return the appropriate instance
	 */
	<T> T getInstance(Key<T> aKey);

	/**
	 * Return the model
	 * 
	 * @return the model
	 */
	M getModel();

	/**
	 * Return the UI
	 * 
	 * @return the ui
	 */
	U getUi();

	/**
	 * start it
	 */
	void start();

	/**
	 * stop it
	 */
	void stop();

}
